package 字符串;



import java.util.Scanner;
import java.util.Stack;

public class 验证回文串 {

    public static Scanner sc1 = new Scanner(System.in);
    public static boolean isPalindrome(String s) {
        Stack<String> stack = new Stack<>();
        String[] split = s.split("");
        StringBuffer sb1 = new StringBuffer();
        StringBuffer sb2 = new StringBuffer();
        int length = s.length();
        boolean flag = false;
        for (int i = 0; i < length; i++) {
            String push = stack.push(split[i]);
            sb1.append(push);

        }

        for (int i = 0; i < length; i++) {
            String pop = stack.pop();
            sb2.append(pop);
        }
        if (sb1.toString().equals(sb2.toString())) {
            return true;
        }
        return false;
    }


    public static void main(String[] args) {
        String input = sc1.nextLine();
        if (isPalindrome(input)) {
            System.out.println("0");
        }else {
            // 返回补全字母数量
        }

    }
}
